﻿using System.Collections;
using System.Collections.Generic;
namespace HurricanePackage
{
    /// <summary>
    /// 消息系统的有参委托缓存池
    /// </summary>
    public class BroadcastCallBackCache : ObjectCache<BroadcastCallBack, List<BroadcastCallDel>>
    {
        public BroadcastCallBackCache():base(1,20)
        {
            Init(new List<BroadcastCallDel>());
        }
        //警告信息
        protected override string WarningTxt => "BroadcastCallbackListCache";

        protected override void _OnCacheInit(List<BroadcastCallDel> _template)
        {
        }

        protected override BroadcastCallBack _CreateItem(List<BroadcastCallDel> _template)
        {
            return new BroadcastCallBack(_template);
        }

        protected override void _DiscardItem(BroadcastCallBack _item)
        {
            _item?.Discard();
        }

        protected override void _ResetItem(BroadcastCallBack _item)
        {
            _item?.Reset();
        }
    }
}

